<?php 

 //fieldspec for filter_id

 //fieldspec for filter_id
$fieldspec["filter_id"] ["show"] = 1;
$fieldspec["filter_id"] ["key"] = 1;
$fieldspec["filter_id"] ["sort"] = 0;
$fieldspec["filter_id"] ["size"] = 20;
$fieldspec["filter_id"] ["rows"] = 1;
$fieldspec["filter_id"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["filter_id"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["filter_id"] ["source"] = "filters";
$fieldspec["filter_id"] ["edit_as"] = "ctl_text";


 //fieldspec for crudset
$fieldspec["crudset_id"] ["col_order"] = 2;
$fieldspec["crudset_id"] ["show"] = 0;
$fieldspec["crudset_id"] ["edit"] = 1;
$fieldspec["crudset_id"] ["sort"] = 0;
$fieldspec["crudset_id"] ["size"] = 4;
$fieldspec["crudset_id"] ["rows"] = 1;
$fieldspec["crudset_id"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["crudset_id"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["crudset_id"] ["source"] = "filters";
$fieldspec["crudset_id"] ["edit_as"] = "ctl_text";
$fieldspec["crudset_id"] ["filter"] = 1;
$fieldspec["crudset_id"] ["add"] = 1;

 //fieldspec for col_id
$fieldspec["col_id"] ["col_order"] = 1;
$fieldspec["col_id"] ["show"] = 1;
$fieldspec["col_id"] ["edit"] = 1;
$fieldspec["col_id"] ["sort"] = 0;
$fieldspec["col_id"] ["size"] = 20;
$fieldspec["col_id"] ["rows"] = 1;
$fieldspec["col_id"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["col_id"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["col_id"] ["source"] = "filters";
$fieldspec["col_id"] ["edit_as"] = "ctl_select";
$fieldspec["col_id"] ["listquery"] = "SELECT variable_id AS keyvalue, variable_name AS showvalue  
	FROM variables 
	JOIN tablesources ON variables.source_id = tablesources.tablesource_id  
	JOIN crudsets ON crudsets.main_table = tablesources.tablesource_id  WHERE 1 "; 
$fieldspec["col_id"] ["listqueryparams"] = array('crudset_id');
$fieldspec["col_id"] ["add"] = 1;
//$fieldspec["col_id"] ["filter"] ["crudcol_id"] ["op"] = '=';






 //fieldspec for filterparam

 //fieldspec for filterparam
$fieldspec["filterparam"] ["col_order"] = 2;
$fieldspec["filterparam"] ["show"] = 1;
$fieldspec["filterparam"] ["edit"] = 1;
$fieldspec["filterparam"] ["sort"] = 0;
$fieldspec["filterparam"] ["size"] = 20;
$fieldspec["filterparam"] ["rows"] = 1;
$fieldspec["filterparam"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["filterparam"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["filterparam"] ["source"] = "filters";
$fieldspec["filterparam"] ["edit_as"] = "ctl_text";
$fieldspec["filterparam"] ["add"] = 1;

 //fieldspec for op

 //fieldspec for op
$fieldspec["op"] ["col_order"] = 3;
$fieldspec["op"] ["show"] = 1;
$fieldspec["op"] ["edit"] = 1;
$fieldspec["op"] ["sort"] = 0;
$fieldspec["op"] ["size"] = 4;
$fieldspec["op"] ["rows"] = 1;
$fieldspec["op"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["op"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["op"] ["source"] = "filters";
$fieldspec["op"] ["edit_as"] = "ctl_select";
$fieldspec["op"] ["list"] = array(
0=>array('keyvalue'=>'=', 'showvalue'=>'='),
1=>array('keyvalue'=>'>', 'showvalue'=>'>'),
2=>array('keyvalue'=>'<', 'showvalue'=>'<'),
3=>array('keyvalue'=>'!=', 'showvalue'=>'!='),
4=>array('keyvalue'=>'LIKE', 'showvalue'=>'LIKE'),
);
 //fieldspec for filterhead

 //fieldspec for filterhead
 
 
 $fieldspec["show"] ["col_order"] = 5;
$fieldspec["show"] ["show"] = 1;
$fieldspec["show"] ["edit"] = 1;
$fieldspec["show"] ["sort"] = 0;
$fieldspec["show"] ["size"] = 20;
$fieldspec["show"] ["rows"] = 1;
$fieldspec["show"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["show"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["show"] ["source"] = "filters";
$fieldspec["show"] ["edit_as"] = "ctl_checkbox";
 
 
$fieldspec["filterhead"] ["col_order"] = 4;
$fieldspec["filterhead"] ["show"] = 1;
$fieldspec["filterhead"] ["edit"] = 1;
$fieldspec["filterhead"] ["sort"] = 0;
$fieldspec["filterhead"] ["size"] = 20;
$fieldspec["filterhead"] ["rows"] = 1;
$fieldspec["filterhead"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["filterhead"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["filterhead"] ["source"] = "filters";
$fieldspec["filterhead"] ["edit_as"] = "ctl_text";


$fieldspec["add"] ["col_order"] = 5;
$fieldspec["add"] ["show"] = 1;
$fieldspec["add"] ["edit"] = 1;
$fieldspec["add"] ["sort"] = 0;
$fieldspec["add"] ["size"] = 20;
$fieldspec["add"] ["rows"] = 1;
$fieldspec["add"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["add"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["add"] ["source"] = "filters";
$fieldspec["add"] ["edit_as"] = "ctl_checkbox";

$fieldspec["source"] ["col_order"] = 5;
$fieldspec["source"] ["show"] = 1;
$fieldspec["source"] ["edit"] = 1;
$fieldspec["source"] ["sort"] = 0;
$fieldspec["source"] ["size"] = 20;
$fieldspec["source"] ["rows"] = 1;
$fieldspec["source"] ["date_show_format"] = "yyyy-mm-dd";
$fieldspec["source"] ["date_source_format"] = "yyyy-mm-dd";
$fieldspec["source"] ["source"] = "filters";
$fieldspec["source"] ["edit_as"] = "ctl_text";


//column settings for delete
$fieldspec['delete'] ['show'] = 1;
$fieldspec['delete'] ['size'] = 20;
$fieldspec['delete'] ['rows'] = 1;
$fieldspec['delete'] ['makefunction'] = 'make_delete';

//$fieldspec["crudset_id"] ["filter"] = 1;
 ?>